<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<h:outputStylesheet name="common-style.css" library="css" />
	<title>Quản trị - Danh bạ khách hàng tiêu dùng POS </title>
	<link rel="shortcut icon" type="image/x-icon"
		href="#{request.contextPath}/resources/images/favicon.ico" />
</h:head>
<h:body style="font-size: 11px;">
	<p:layout style="height:800px;width:1200px; margin:0 auto;" id="layout">
		<p:layoutUnit position="center">
			<p:graphicImage value="/resources/images/MDB.jpg" width="250"
				height="90" />

			<p:ajaxStatus onstart="modalDialogTest.show();"
				onsuccess="modalDialogTest.hide();" />
			<p:dialog id="modalDialog" showHeader="false" closable="true"
				widgetVar="modalDialogTest" modal="true">
				<p:graphicImage value="/resources/images/482.GIF" />
			</p:dialog>
			<h:form id="frmMainLoans">
				<ui:insert name="menu">
					<ui:include src="/admin/menu.xhtml" />
				</ui:insert>
				<p:panel
					header="KHÁCH HÀNG TIÊU DÙNG POS">
					<p:growl id="growl_ID" showDetail="true" sticky="true" />
					<p:dataTable id="dtbLoansInfo" var="IB"
						value="#{cardSmsBean.cardSmsDataModel}"
						selection="#{cardSmsBean.cardSmsSelected}" selectionMode="single"
						sortMode="multiple" emptyMessage="Không có dữ liệu"
						paginator="true" rows="15"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="10,15,20" paginatorPosition="bottom">
						<f:facet name="header">
							<h:outputText value="DANH SÁCH HỢP ĐỒNG VAY GỬI TIN NHẮN"
								style="float:right;" />
							<p:calendar value="#{cardSmsBean.processDate}" style="float:left;" />
							<p:commandButton icon="ui-icon-search"
								action="#{cardSmsBean.searchLoansByDate}" update="dtbLoansInfo"
								style="float:left;margin:0 auto;height:25px;" />
						</f:facet>
						<p:column headerText="STT">
							<h:outputText value="#{cardSmsBean.cardSmsDataModel.rowIndex + 1}"
								styleClass="textBold" />
						</p:column>
						<p:column sortBy="#{IB.processDate}" headerText="NGÀY XỬ LÝ">
							<h:outputText value="#{IB.processDate}" styleClass="textBold">
								<f:convertDateTime type="date" pattern="dd/MM/yyyy" />
							</h:outputText>
						</p:column>
						<p:column>
							<f:facet name="header">
								<h:outputText value="GCIF" />
							</f:facet>
							<h:outputText value="#{IB.customerId}" styleClass="textBold" />
						</p:column>
						
						<p:column>
							<f:facet name="header">
								<h:outputText value="SỐ ĐIỆN THOẠI" />
							</f:facet>
							<h:outputText value="#{IB.phoneNum}" styleClass="textBold" />
						</p:column>
					

						<p:column>
							<f:facet name="header">
								<h:outputText value="THÁNG" />
							</f:facet>
							<h:outputText value="#{IB.periodCode}/#{IB.finCycle}"
								styleClass="textBold" />
						</p:column>

						<p:column>
							<f:facet name="header">
								<h:outputText value="SỐ LẦN CHUYỂN KHOẢN" />
							</f:facet>
							<h:outputText value="#{IB.totalCounterTxn}" styleClass="textBold"/>
						</p:column>
						<p:column>
							<f:facet name="header">
								<h:outputText value="SỐ TIỀN CHUYỂN KHOẢN" />
							</f:facet>
							<h:outputText value="#{IB.totalAmtTxn}" styleClass="textBold">
							<f:convertNumber locale="en" pattern="#,##0.00;(#,##0.00)" />
							</h:outputText>
						</p:column>			
						<p:column>
							<f:facet name="header">
								<h:outputText value="DỰ THƯỞNG" />
							</f:facet>
							<h:outputText value="#{IB.lkdNum}" styleClass="textBold" />
						</p:column>
						<p:column>
							<f:facet name="header">
								<h:outputText value="NGÀY CẬP NHẬT" />
							</f:facet>
							<h:outputText value="#{IB.updatedDate}" styleClass="textBold">
							<f:convertDateTime type="date" pattern="dd/MM/yyyy HH:mm:ss"/>
							</h:outputText>
						</p:column>
						<p:column>
							<f:facet name="header">
								<h:outputText value="CẬP NHẬT BỞI" />
							</f:facet>
							<h:outputText value="#{IB.updatedBy}" styleClass="textBold" />
						</p:column>
					</p:dataTable>
					<h:panelGrid columns="3" id="frmExportData2Excell">
						<p:commandButton value="Xử lý để xuất tập tin excell"
							icon="ui-icon-arrow-4-diag"
							action="#{cardSmsBean.createExcelIBByPoi}"
							update="frmExportData2Excell,:frmMainLoans:growl_ID,:frmMainLoans:pngDateProcess">
						</p:commandButton>
						<p:commandButton ajax="false" value="Tải về máy"
							icon="ui-icon-arrowthickstop-1-s"
							disabled="#{cardSmsBean.btnVisible == false}"
							action="#{cardSmsBean.downloadPreventedLoans}">
							<p:fileDownload value="#{cardSmsBean.file}"
								contentDisposition="attachment">
							</p:fileDownload>
						</p:commandButton>
						
					</h:panelGrid>
					<h:panelGrid columns="4" id="pngDateProcess">
						<h:outputText value="Đã xử lý ngày: " />
						<h:outputText value="#{cardSmsBean.lastUpdated}"  style="color:red;">
						<f:convertDateTime type="date" pattern="dd/MM/yyyy" />
						</h:outputText>
						<h:outputText value="Ngày xử lý tiếp theo: " />
						<h:outputText value="#{cardSmsBean.nextProcess}" style="color:red;">
						<f:convertDateTime type="date" pattern="dd/MM/yyyy" />
						</h:outputText>
					</h:panelGrid>
				</p:panel>
			</h:form>
		</p:layoutUnit>
		<h:outputText
			value="Bản quyền &#169; 2013 Ngân hàng TMCP Phát Triển Mê Kông. Xây dựng bởi Đỗ Đức Tú."
			style="font-style:italic;" />
	</p:layout>
</h:body>
</html>